1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a recording medium.
2. Description of the Related Art
It is known to utilise a machine learning algorithm to interpreting given data. Examples of what is determined by interpreting data include the state of data in view of the future development in a match of shogi, go, or the like, whether or not an object captured in an image is a person, and how the person is captured and what is a background in a captured scene. Machine learning is used in a wide range of applications including text identification, speech identification, image identification, and prediction of future progress, depending on data to which machine learning is applied.
Methods for discriminating a material or performing detect inspection using a machine learning algorithm are already known. However, the conventional material discrimination and the conventional defect inspection using machine learning are disadvantageous in that, if a plurality of targets of the same type but in different conditions are contained in an image, accuracy of material discrimination or defect inspection will be insufficient.
For example, when defect detection is performed on an image containing a plurality of targets, e.g., screws that differ from each other in thread starting position, it is possible that, even though the difference in the thread starting position is not a defect, a difference between images caused by a difference in the thread starting position is undesirably determined as a defect. If a threshold value for this determination is set to a value that permits the difference, tolerance for defects is also widened, which undesirably decreases defect detection sensitivity.
Image-based defect inspection methods are conventionally known. For example, Japanese Unexamined Patent Application Publication No. 2005-265661 discloses the following method. On a per-pixel basis, mean values and standard deviations of brightness values are calculated based on a group of images of good products provided in advance. In inspection, for each pixel of an image to be inspected, the deviation value of the brightness value is calculated (the mean value is subtracted from the brightness value and then the difference is divided by the standard deviation), and a pixel whose deviation value is higher than a preset threshold value is determined as anomalous (an outlier).
However, the technique described in Japanese Unexamined Patent Application Publication No. 2005-265661 is not suitable for inspection of targets such that a plurality of target are in an image and that thus vary widely.